package com.xiaoh.dormitoryrepairreportbackend.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 物料表
 */
@TableName(value = "material")
@Data
@Schema(description = "物料表")
public class Material implements Serializable {

    /**
     * 物料ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "物料ID")
    private Integer id;

    /**
     * 物料名称
     */
    @TableField(value = "name")
    @Schema(description = "物料名称")
    private String name;

    /**
     * 规格型号
     */
    @TableField(value = "model")
    @Schema(description = "规格型号")
    private String model;

    /**
     * 单位(个/米/套)
     */
    @TableField(value = "unit")
    @Schema(description = "单位(个/米/套)")
    private String unit;

    /**
     * 库存数量
     */
    @TableField(value = "stock_count")
    @Schema(description = "库存数量")
    private Integer stockCount;

    /**
     * 库存预警值
     */
    @TableField(value = "warning_threshold")
    @Schema(description = "库存预警值")
    private Integer warningThreshold;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    /**
     * 逻辑删除(0:未删除, 1:已删除)
     */
    @TableField(value = "is_deleted")
    @TableLogic
    @Schema(description = "逻辑删除(0:未删除, 1:已删除)")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
